﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Mobile.Models.ArticleViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Chi tiết
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if (Model.Articles.Count() == 0)
  { %>
    <div class="mar_top">
      <form action="/Article/Index/" method="post">
        <input type="text" name="Articlename" />
        <%=Html.DropDownList("ddlArticleCategory", new SelectList(Model.ArticleCategorys, "ID", "Name"), "-- Chọn Danh mục -- ", new { })%>
       <label>&nbsp;</label><input type="submit" value="" class="btn" />
     </form>
     </div>
    <h3>Không Tồn tại tin này</h3>
  <%}
  else
  { %>
    <% foreach (var item in Model.Articles)
       {%>
<div class="mar_top">
      <form action="/Article/Index/" method="post">
        <input type="text" name="Articlename" />
        <%=Html.DropDownList("ddlArticleCategory", new SelectList(Model.ArticleCategorys, "ID", "Name"), "-- Chọn danh mục -- ", new { })%>
       <label>&nbsp;</label><input type="submit" value="" class="btn" />
        </form>
    </div>
        <br />
    <%
           string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 230, 120, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo;         
    %>
    <div class="tit_bg" style="font-weight:bold"><%=item.ArticleCategory.Name%></div>
       <h3><%= item.Title%></h3>
       <div class="datetime"><%= item.AddDate%></div>
       <p><strong><%= item.Summary%></strong></p> <br />
          <p><%= item.ArticleContent%></p>
    <div class="m_midle">   
        <ul>
                <li><a href="/Article/Index/<%=item.CatID %>" class="l_gr">Quay lại</a></li>
                <li><a href="/Home/Detail/" class="l_gr">Trang chủ</a></li>
                <li><a href="#top" class="l_gr">Lên đầu trang</a></li>
        </ul>    
    </div>
    <div class="clear"></div>
    <div class="tit_bg" style="font-weight:bold">Tin khác</div>
    <div class="clear"></div>
       <% Html.RenderAction("LastedArticle", "Article", new { number = item.ID, catid = item.CatID, skip = 1, order = "ID", orderDir = "desc", title = "Tin tức" }); %>     
		<br />
     <% }
  }%>
</asp:Content>
